<?PHP

	class tpl_defaultstyles {
		
		public static function defaultstyles(){
		
			$selectors = array();
			foreach($GLOBALS['OUTPUT']->style_selectors as $type=>$arr){
				
				$selectors[$type] = '';
				$class = 'td2';
				
				switch($type){
					case 'font':
						$style = "font-family: _v;";
					break;
					case 'color':
						$style = "color: _v;";
					break;
					case 'size':
						$style = "font-size: _vpx;";
					break;
				}
				
				foreach($arr as $label=>$value){
					
					$link = base64_encode($label);
					$stylev = str_replace("_v",$value,$style);
					
					if($GLOBALS['OUTPUT']->default_styles[$type] != $value){
						$links = <<<EOV
<a href='./index.php?act=admin&page=defaultstyles{$GLOBALS['OUTPUT']->ses}&type=$type&del=$link'>[{$GLOBALS['LANG']->lang_admin->delete}]</a> <a href='./index.php?act=admin&page=defaultstyles{$GLOBALS['OUTPUT']->ses}&type=$type&default=$link'>[{$GLOBALS['LANG']->lang_admin->makedefault}]</a>
EOV;
					}else{
						$links = "<i>{$GLOBALS['LANG']->lang_admin->default}</i>";
						$stylev .= 'font-weight: bold;';
					}
					
					$selectors[$type] .= <<<EOV
<tr>
	<td class='$class' style='$stylev'>$label</td>
	<td class='$class' style='$stylev'>$value</td>
	<td class='$class'>{$links}</td>
</tr>
EOV;
					$class = ($class == 'td2' ? 'td1' : 'td2');
				}
				
			}
			
			return	tpl_globals::header() .
				<<<EOV
	<form action='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=defaultstyles&type=font' method='post'>
	
		<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->pmted_fonts}</div>
		<table style='width: 100%;' cellspacing='1' cellpadding='5'>
			<tr>
				<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->label}</td>
				<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->value}</td>
				<td class='table_header_row' width='20%'>{$GLOBALS['LANG']->lang_formcommon->submit}</td>
			</tr>
			{$selectors['font']}
		</table>
		
		<br />
		
		<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->add_font}</div>
		<table style='width: 100%;' cellspacing='1' cellpadding='5'>
			<tr>
				<td class='td2'>
					{$GLOBALS['LANG']->lang_admin->label}
				</td>
				<td class='td2'>
EOV
.
					tpl_form::text_password_file('text','add') .
					<<<EOV
				</td>
			</tr>
			<tr>
				<td class='td2'>
					{$GLOBALS['LANG']->lang_admin->value}
				</td>
				<td class='td2'>
EOV
.
					tpl_form::text_password_file('text','value') .
					<<<EOV
				</td>
			</tr>
			<tr>
				<td class='table_header_row' colspan='3'><input class='form_button_norm' onmouseout="this.className=this.className.replace('_over','_norm');" onmouseover="this.className=this.className.replace('_norm','_over');" type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' /></td>
			</tr>
		</table>
		
	</form>
	
	<br />
	
	<form action='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=defaultstyles&type=size' method='post'>
	
		<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->pmted_sizes}</div>
		<table style='width: 100%;' cellspacing='1' cellpadding='5'>
			<tr>
				<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->label}</td>
				<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->value}</td>
				<td class='table_header_row' width='20%'>{$GLOBALS['LANG']->lang_formcommon->submit}</td>
			</tr>
			{$selectors['size']}
		</table>
		
		<br />
		
		<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->add_size}</div>
		<table style='width: 100%;' cellspacing='1' cellpadding='5'>
			<tr>
				<td class='td2'>
					{$GLOBALS['LANG']->lang_admin->label}
				</td>
				<td class='td2'>
EOV
.
					tpl_form::text_password_file('text','add') .
					<<<EOV
				</td>
			</tr>
			<tr>
				<td class='td2'>
					{$GLOBALS['LANG']->lang_admin->value}
				</td>
				<td class='td2'>
EOV
.
					tpl_form::text_password_file('text','value') .
					<<<EOV
				</td>
			</tr>
			<tr>
				<td class='table_header_row' colspan='3'><input class='form_button_norm' onmouseout="this.className=this.className.replace('_over','_norm');" onmouseover="this.className=this.className.replace('_norm','_over');" type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' /></td>
			</tr>
		</table>
		
	</form>
	
	<br />
	
	<form action='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=defaultstyles&type=color' method='post'>
	
		<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->pmted_colors}</div>
		<table style='width: 100%;' cellspacing='1' cellpadding='5'>
			<tr>
				<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->label}</td>
				<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->value}</td>
				<td class='table_header_row' width='20%'>{$GLOBALS['LANG']->lang_formcommon->submit}</td>
			</tr>
			{$selectors['color']}
		</table>
		
		<br />
		
		<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->add_color}</div>
		<table style='width: 100%;' cellspacing='1' cellpadding='5'>
			<tr>
				<td class='td2'>
					{$GLOBALS['LANG']->lang_admin->label}
				</td>
				<td class='td2'>
EOV
.
					tpl_form::text_password_file('text','add') .
					<<<EOV
				</td>
			</tr>
			<tr>
				<td class='td2'>
					{$GLOBALS['LANG']->lang_admin->value}
				</td>
				<td class='td2'>
EOV
.
					tpl_form::text_password_file('text','value') .
					<<<EOV
				</td>
			</tr>
			<tr>
				<td class='table_header_row' colspan='3'><input class='form_button_norm' onmouseout="this.className=this.className.replace('_over','_norm');" onmouseover="this.className=this.className.replace('_norm','_over');" type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' /></td>
			</tr>
		</table>
		
	</form>
EOV
.
			tpl_globals::footer();
			
		}
		
	}
?>